home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
UTIL
/
MEMORY
/
OLD
/
MEM208SRC
/
FSLib
/
c
/
_Args
next >
Wrap
Text File
|
1993-08-22
|
2KB
|
70 lines
/* Original code (c) Acorn Computers Ltd, 1992-3 */
/* $Id: c._Args 3.1 93/03/09 20:15:13 brian Exp $ */
#include "FS.h"
/* #define DEBUG */
_kernel_oserror *fsentry_args( FSEntry_Args_Parameter *parm )
{
FileEntry *fe=(FileEntry *)parm->_.handle;
FileDesc d = FileEntry_Desc( fe );
#ifdef DEBUG
printf("Args(%d)\n",parm->reason);
#endif
switch( parm->reason )
{
case FSEntry_Args_Reason_ReadSequentialFilePointer:
if (d.buffered)
return ERR(mb_BadParameters);
parm->arg.sequential_pointer=FileEntry_SeqPtr(fe);
return NULL;
case FSEntry_Args_Reason_WriteSequentialFilePointer:
if (d.buffered)
return ERR(mb_BadParameters);
return FileEntry_SetSeqPtr(fe, parm->arg.sequential_pointer );
case FSEntry_Args_Reason_ReadFileExtent:
if (d.buffered)
return ERR(mb_BadParameters);
parm->arg.extent=d.length;
return NULL;
case FSEntry_Args_Reason_WriteFileExtent:
return FileEntry_SetLength(fe,parm->arg.extent);
case FSEntry_Args_Reason_ReadSizeAllocatedToFile:
parm->arg.allocation_size=FileEntry_Allocated(fe);
return NULL;
case FSEntry_Args_Reason_EOFCheck:
if (d.buffered)
return ERR(mb_BadParameters);
parm->_.Not_Yet_EOF=FileEntry_SeqPtr(fe)!=d.length;
return NULL;
case FSEntry_Args_Reason_FlushFileBuffer:
parm->arg.info=d.info;
return FileEntry_Flush(fe);
case FSEntry_Args_Reason_EnsureFileSize:
{
_kernel_oserror *err=FileEntry_EnsureSize(fe,parm->arg.allocation_size);
parm->arg.allocation_size=FileEntry_Allocated(fe);
return err;
}
case FSEntry_Args_Reason_WriteZerosToFile:
return FileEntry_PutZeros(fe,parm->arg.write_zeros.start,parm->arg.write_zeros.number);
case FSEntry_Args_Reason_ReadFileDateStamp:
parm->arg.info=d.info;
return NULL;
case 10:
return NULL;
default:
return ERR(mb_BadParameters);
}
}